package cn.wusifx.zabbix.request.builder.action;

import cn.wusifx.zabbix.request.BaseRequest;
import cn.wusifx.zabbix.request.builder.CreateRequestBuilder;

import java.util.Map;

/**
 * https://www.zabbix.com/documentation/4.0/manual/api/reference/action/create
 */
public class ActionCreateRequestBuilder extends CreateRequestBuilder {
    private String name;
    private String escPeriod;
    private Integer eventSource;

    public ActionCreateRequestBuilder(Long id,String auth){
        super("action.create",id,auth);
    }

    public ActionCreateRequestBuilder(String auth){
        super("action.create",auth);
    }

    public String getEscPeriod() {
        return escPeriod;
    }

    public ActionCreateRequestBuilder setEscPeriod(String escPeriod) {
        this.escPeriod = escPeriod;
        return this;
    }

    public Integer getEventSource() {
        return eventSource;
    }

    public ActionCreateRequestBuilder setEventSource(Integer eventSource) {
        this.eventSource = eventSource;
        return this;
    }

    public String getName() {
        return name;
    }

    public ActionCreateRequestBuilder setName(String name) {
        this.name = name;
        return this;
    }

    @Override
    public BaseRequest<Map<String, Object>> builder() {
        baseRequest.getParams().put("name",name);
        baseRequest.getParams().put("eventsource",eventSource);
        baseRequest.getParams().put("esc_period",escPeriod);
        return baseRequest;
    }


}
